import { 
    LOADING_DATA,
    CALLBACK_ERROR
} from '../actions/LoadingActions';

const initialState = {
    isLoading: false,
    callbackError: null
}

const LoadingReducer = (state = initialState, action) => {
    switch (action.type) {
        case LOADING_DATA:
            return {
                ...state,
                isLoading: action.data,
            }
        case CALLBACK_ERROR:
            return {
                ...state,
                callbackError: action.data,
            }
        default:
            return {...state};
    }
};

export default LoadingReducer;